using System;
using System.Collections.Generic;
using System.Linq;
using Microsoft.Xna.Framework;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.GamerServices;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework.Media;


namespace AtlantisRevenge.GamePlay.Estados
{
    /// <summary>
    /// This is a game component that implements IUpdateable.
    /// </summary>
    public class Menu : EstadoBase
    {
        Botao play;
        Botao recordes;
        Botao creditos;
        Botao sair;
        Texture2D titulo;
        Vector2 posicaoTitulo;

        public Menu(ContentManager Content, GameWindow Window)
            : base(Content, Window)
        {
            fundo = Content.Load<Texture2D>("Backgrounds/atlantis");

            titulo = Content.Load<Texture2D>("Sprites/titulo");
            posicaoTitulo.X = Window.ClientBounds.Width / 2 - titulo.Width / 2;
            posicaoTitulo.Y = Window.ClientBounds.Height * 0.1f;

            play = new Botao(Content, Window, "Botoes/jogar");
            recordes = new Botao(Content, Window, "Botoes/recordes");
            creditos = new Botao(Content, Window, "Botoes/creditos");
            sair = new Botao(Content, Window, "Botoes/sair");

            play.posicao.X = Window.ClientBounds.Width / 2 - play.textura.Width / 2;
            play.posicao.Y = posicaoTitulo.Y * 3;

            recordes.posicao.X = Window.ClientBounds.Width / 2 - recordes.textura.Width / 2;
            recordes.posicao.Y = play.posicao.Y + 100;

            creditos.posicao.X = Window.ClientBounds.Width / 2 - creditos.textura.Width / 2;
            creditos.posicao.Y = recordes.posicao.Y + 100;

            sair.posicao.X = Window.ClientBounds.Width / 2 - sair.textura.Width / 2;
            sair.posicao.Y = creditos.posicao.Y + 100;
        }
        public void Update(GameTime gameTime)
        {
            play.Update(gameTime);
            recordes.Update(gameTime);
            creditos.Update(gameTime);
            sair.Update(gameTime);
        }
        public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
        {
            spriteBatch.Draw(fundo, VetorZero, cor);
            spriteBatch.Draw(titulo, posicaoTitulo, cor);
            play.Draw(gameTime,spriteBatch);
            recordes.Draw(gameTime,spriteBatch);
            creditos.Draw(gameTime,spriteBatch);
            sair.Draw(gameTime, spriteBatch);
        }
    }
}
